feat: stato 'chiusa per gelatino' su doppio click - #15
Merged
Conversation
Hardware (pulsante ESP32): - on_press sostituito da on_multi_click con due timing pattern - click singolo: toggle standard invariato - doppio click veloce: POST /toggle con reason='gelatino', LED azzurro (R 0% / G 50% / B 100%) Backend: - SedeStatus.Reason: nuova colonna stringa per tracciare la causa della chiusura (vuota = toggle normale, 'gelatino' = chiusura forzata per gelato). Migrata automaticamente via AutoMigrate. - ToggleStatusRequest accetta 'reason' opzionale (json omitempty). Quando reason='gelatino' la toggle e' idempotente sulla chiusura (forza IsOpen=false invece di flippare) cosi' il doppio-click chiude sempre, anche se la sede e' gia' chiusa. - Telegram: messaggio dedicato con emoji gelato per le chiusure gelatino. - spaceapi.json: state.message segnala 'Chiusa per gelatino' quando la chiusura corrente ha reason=gelatino. Retro-compatibile: client che non inviano 'reason' (ESP32 vecchio firmware, MCP server, integrazioni terze) seguono il vecchio percorso toggle. /status continua a restituire true/false testuale.
Codecov Report❌ Patch coverage is
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cosa
Aggiunge lo stato "chiusa per gelatino" innescato da un doppio click veloce sul pulsante fisico.
Hardware (
pulsante-sede.yaml)on_presssostituito daon_multi_clickcon due timing pattern./toggleconreason: "gelatino", LED azzurro (R 0% / G 50% / B 100%).Backend
SedeStatus.Reason: nuova colonna stringa. Migrata automaticamente viaAutoMigrate.ToggleStatusRequest.reasonopzionale (json:"reason,omitempty"). Quandoreason="gelatino"la toggle è idempotente sulla chiusura (forzaIsOpen=falseinvece di flippare) — il doppio click chiude sempre, anche se la sede è già chiusa.spaceapi.json:state.messagesegnala "Chiusa per gelatino 🍦" quando la chiusura corrente hareason=gelatino.Retro-compatibilità
reason(ESP32 vecchio firmware, MCP server, integrazioni terze) seguono il vecchio percorso toggle./statuscontinua a restituiretrue/falsetestuale.Test
go test ./...da eseguire localmente — sandbox senza toolchain Go.